﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ExtraOpdrachten
{
    public partial class Opdracht4 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnCalculate_Click(object sender, EventArgs e)
        {
            double uren = int.Parse(txtHours.Value);
            double baseCar = 5;
            double baseTruck = 6;
            double hourCar = 3;
            double hourTruck = 3.5;
            double bill = 0;
            if(rbCar.Checked)
            {
                bill = baseCar + (uren - 1) * hourCar;
                if (bill > 38) bill = 38;
            }
            else if (rbTruck.Checked)
            {
                bill = baseTruck + (uren - 1) * hourTruck;
                if (bill > 44.5) bill = 44.5;
            }
            lblResult.Text = "€ " + bill.ToString("n2");
        }

        protected void btnEvent_Click(object sender, EventArgs e)
        {
            lblResult.Text = "€ 19,00";
        }
    }
}